function getXmlHttpRequestObject()
{
  if (typeof window.XMLHttpRequest != 'undefined')
  {
    XMLHTTP = new XMLHttpRequest;
  } else if (typeof window.ActiveXObject) {
    try {
      XMLHTTP = new ActiveXObject('Msxml2.XMLHTTP');
    } catch (ex) {
      try {
        XMLHTTP = new ActiveXObject('Microsoft.XMLHTTP');
      } catch (ex) {
      }
    }
  }
  return(XMLHTTP);
}

function doXmlHttpRequest(url, handlerFunction)
{
  var request = getXmlHttpRequestObject();
  // we use synchronous transfer when we need to wait for the field
  // update to finish executing while closing a form, async in all other cases

  request.onreadystatechange = function handleValidatorFeedback (evt)
  {
    if (request.readyState == 4) // request completed
    {
      handlerFunction(request.responseText);		
    }
  }

  request.open('get', url, true);
  request.setRequestHeader("Content-type", "text/xml");
  request.send(null);
}
